import request from '@/utils/request'

// 商品类目树形
export function productCategoryTree(query) {
  return request({
    url: '/business/category/productCategoryTree',
    method: 'get',
    params: query
  })
}
// 美团商品类目树形
export function meituanTree(query) {
    return request({
      url: '/business/tree/CategoryTree',
      method: 'get',
      params: query
    })
  }

  // 根据美团类目查询属性
export function getCategoryAttributesById(query) {
    return request({
      url: '/business/attribute/'+query,
      method: 'get',
      params: query
    })
  }

// 上传文件的函数
export function uploadFile(formData) {
  return request({
    url: '/business/spu/import',
    method: 'post',
    data: formData,  // 将 formData 作为请求数据传递
    headers: {
      'Content-Type': 'multipart/form-data',  // 确保设置为 multipart/form-data
    }
  })
}
